// 后台路由
import Layout from '../components/Layout/index.vue';

import userList from "../views/admin/userList.vue";
import goodsList from "../views/admin/goodsList.vue"
import goodsTypeList from "../views/admin/goodsTypeList.vue";
import orderList from "../views/admin/orderList.vue";
import commentList from "../views/admin/commentList.vue";

import login from '../views/admin/login.vue';
// import adminHome from '../views/admin/home.vue';
import notFound from '../views/admin/notFound.vue'

export default [
    {
        path: "/admin",
        redirect: "/main",
    },
    {
        path: "/admin/login",
        name: 'adminLogin',
        component: login,
    },
    // {
    //     path: '/main',
    //     component: Layout,
    //     redirect: '/adminHome',
    //     children: [
    //         {
    //             path: '/adminHome',
    //             name: 'AdminHome',
    //             component: adminHome,
    //         },
    //     ],
    // },
    {
        path: '/main',
        component: Layout,
        redirect: '/user/userList',
    },
    {
        path: "/goods",
        name: "商品管理",
        component: Layout,
        children: [
            {
                path: 'goodsList',
                name : 'goodsList',
                component: goodsList,
            }
        ]
    },
    {
        path: "/goodsType",
        name: "商品类型管理",
        component: Layout,
        children: [
            {
                path: 'goodsTypeList',
                name : 'goodsTypeList',
                component: goodsTypeList,
            }
        ]
    },
    {
        path: "/user",
        name: "用户管理",
        component: Layout,
        children: [
            {            
                path: 'userList',
                name: 'userList',
                component: userList,
            }
        ]
    },
    {
        path: "/order",
        name: "订单管理",
        component: Layout,
        children: [
            {            
                path: 'orderList',
                name: 'orderList',
                component: orderList,
            }
        ]
    },
    {
        path: "/comment",
        name: "评价管理",
        component: Layout,
        children: [
            {            
                path: 'commentList',
                name: 'commentList',
                component: commentList,
            }
        ]
    },
    // 404
    {
        path: '/:pathMatch(.*)*',
        name: 'NotFound',
        component: notFound,
    },
];